<template>
  <div>
    <NstdRadioGroup v-model="size" label="size control" :options="options">
    </NstdRadioGroup>
    <NstdRadioGroup v-model="labelPosition" label="position control" :options="options1">
    </NstdRadioGroup>
  </div>
  <br />
  <NstdForm
    ref="form"
    :model="sizeForm"
    label-width="auto"
    :label-position="labelPosition"
    :size="size"
  >
    <NstdFormItem label="Activity name">
      <NstdInput v-model="sizeForm.name" />
    </NstdFormItem>
    <NstdFormItem label="Activity zone">
      <NstdSelect
        v-model="sizeForm.region"
        placeholder="please select your zone"
      >
        <NstdOption label="Zone one" value="shanghai" />
        <NstdOption label="Zone two" value="beijing" />
      </NstdSelect>
    </NstdFormItem>
    <NstdFormItem label="Activity time">
      <el-col :span="11">
        <NstdDatePicker
          v-model="sizeForm.date1"
          type="date"
          label="Pick a date"
          placeholder="Pick a date"
          style="width: 100%"
        />
      </el-col>
      <el-col class="text-center" :span="1" style="margin: 0 0.5rem">-</el-col>
      <el-col :span="11">
        <NstdTimePicker
          v-model="sizeForm.date2"
          label="Pick a time"
          placeholder="Pick a time"
          style="width: 100%"
        />
      </el-col>
    </NstdFormItem>
    <NstdFormItem label="Activity type">
      <NstdCheckboxGroup v-model="sizeForm.type" :options="options4">
      </NstdCheckboxGroup>
    </NstdFormItem>
    <NstdFormItem label="Resources">
      <NstdRadioGroup v-model="sizeForm.resource" :options="options3">
      </NstdRadioGroup>
    </NstdFormItem>
    <NstdFormItem>
      <NstdButton type="primary" @click="onSubmit">Create</NstdButton>
      <NstdButton>Cancel</NstdButton>
    </NstdFormItem>
  </NstdForm>
</template>

<script lang="ts" setup>
import { reactive, ref } from 'vue'
const options4 = [
  {
    type: 'button',
    label: 'Online activities',
    value: 'Online activities',
    name: 'type'
  },
  {
    type: 'button',
    label: 'Promotion activities',
    value: 'Promotion activities',
    name: 'type'
  },
]
const options3 = [
  {
    type: 'radio',
    label: 'Sponsor',
    value: 'Sponsor',
    border: true
  },
  {
    type: 'radio',
    label: 'Venue',
    value: 'Venue',
    border: true
  }
]
const options2 = [
  {
    label: 'Zone one',
    value: 'shanghai',
  },
  {
    label: 'Zone two',
    value: 'beijing',
  }
]
const options1 = [
  {
    type: 'button',
    label: 'Left',
    value: 'left'
  },
  {
    type: 'button',
    label: 'Right',
    value: 'right'
  },
  {
    type: 'button',
    label: 'Top',
    value: 'top'
  }
]
const options = [
  {
    type: 'button',
    label: 'large',
    value: 'large'
  },
  {
    type: 'button',
    label: 'default',
    value: 'default'
  },
  {
    type: 'button',
    label: 'small',
    value: 'small'
  }
]

const size = ref('default')
const labelPosition = ref('right')

const sizeForm = reactive({
  name: '',
  region: '',
  date1: '',
  date2: '',
  delivery: false,
  type: [],
  resource: '',
  desc: '',
})

function onSubmit() {}
</script>

<style>
.NstdRadioGroup {
  margin-right: 12px;
}
</style>
